<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonList.jsp"%>
<%@ include file="/commons/tabs.jsp"%>
<html>
<head>
<title></title>
<script type="text/javascript" src="${ctx }/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript" src="${ctx}/pages/com/ce/pms/house/proRightModification/stringfilter.js"></script>
<script type="text/javascript">

 /**
  * 列表类型
  */
  var listType = "goOutOne";

  function  setCurrentGoOutId(goOutID){
  	document.getElementById("goOutId").value = goOutID;
  }

 /**
  * 功能描述：打开“增加退伙申请” 窗口
  * @author 张红丽
  * Created on : 2008-8-14
  */
 function openWithdrawAdd(){
   var pageNo = document.frames["proRightModIfm"].document.getElementById("ec_p").value;
   var url = "${ctx}/house_proRightModificationAction.do?method=initGoOutAdd";
   top.windowOpen(url, "goOutAdd", "${key.go_out_add_apply}", 530, 700,true,"goOutAddWinIfm");
 }

  /**
  * 功能描述：打开"修改退伙申请" 窗口
  * @author 张红丽
  * Created on : 2008-8-14
  */
 function openWithdrawEdit(){
  var goOutId =document.getElementById("goOutId").value;
  var iframe = document.frames["proRightModIfm"];
   if(!iframe.currentGoOutId){
    	Alert("${key.select_edit_record}");
   }else{
		var url = "${ctx}/house_proRightModificationAction.do?method=checkGoOutStatus&goOutId="+goOutId;
  		new Ajax.Request(url,
    	{
    		method:'post',
    		parameters:{keyword:iframe.currentGoOutId},
    		onSuccess:function(response){
    	     var statusCode = response.responseText;
    	      if(statusCode != "new"){	//先检查是不是新建状态的记录
    	        Alert("${key.edit_record_new}");
    	      }else{
    	        var url = "${ctx}/house_proRightModificationAction.do?method=initGoOutEdit&goOutId="+iframe.currentGoOutId;
       			top.windowOpen(url, "goOutEdit", "${key.go_out_edit_apply}", 530, 700,true,"goOutEditWinIfm");
    	      }
    		}
    	});
   }
 }
  /**
  * 功能描述： 刷新列表
  */
  function refreshList(){
	var url = "${ctx}/house_proRightModificationAction.do?method=initProRightModificationListMain";
	window.location.href=url;
  }


	function submitResearch(){
	 if(event.keyCode==13){
	 	search(0);
	 }
	 return ;
	}

  /**
   * 搜索
   */
   function search(type){
        var form = null;
        var isTrue = null;
        //如果查询退伙列表
    	if(type == 0){
    		form = $('searchGoOutForm');

    		//查询退伙第一个列表
    		if(listType == "goOutOne"){
			  form.action = "${ctx}/house_proRightModificationAction.do?method=goOutList";
    		}else{
    		  form.action = "${ctx}/house_proRightModificationAction.do?method=goOutListTwo";
    		}
    	}
   		else if(type == 1){
   			form = $('searchModForm');
   		}
		isTrue = form.fireEvent("onBlur");
		if(isTrue){
			form.submit();
		}

		/*if(type == 0){
			document.frames["proRightModIfm"].document.location.href=encodeURI(encodeURI("${ctx}/house_proRightModificationAction.do?method=goOutList&houseNumber="+$(param1).value+"&ownerName="+$(param2).value));
		}else if(type == 1){
		  var index = $(param1).selectedIndex;
		  var buildingId = $(param1).options[index].value;
		  document.frames["proRightModIfm"].document.location.href="${ctx}/house_proRightModificationAction.do?method=proRightModificationList&houseNumber="+$(param2).value+"&buildingId="+buildingId;
		}*/
   }



  /**
   * 功能描述: 选择退伙列表
   */
	function setListType(type){
		listType = type;
	}

	//打印
	function goOutPrint(){
		var goOutId = document.getElementById("goOutId").value;
		if (goOutId == "" || goOutId  == null){
			Alert("请选择一条数据");
			return ;
		}
		document.getElementById("printFrom").action ="${ctx}/applets/appletShow.jsp?reportName=GoOutReportService&goOutId="+goOutId;
		document.getElementById("printFrom").submit();
	}

</script>
</head>
<body style="overflow: auto;">

<form id="printFrom" name="printFrom" method="post"
	  action="" target="_blank">
</form>
<input type="hidden" name="goOutId" id="goOutId" value="" >
<div class="pageNav_bg">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td id="pageNav_leftimg"><img src="${ctx }/images/ico_zfgx.gif" width="46" height="47"/></td>
      <td id="navWord"><span class="page_title">${key.pro_right_change }</span></td>
      <td class="pageNav_right"><a href="javascript:showFull_in();"><img id="full_image"  src="${ctx }/images/ico_fullscreen.gif" border="0"/></a></td>
    </tr>
  </table>
</div>

<div id="goOutSearch" style="display:none">
<form name="searchGoOutForm" id="searchGoOutForm" method="post" target="proRightModIfm" action="" method="post">
 <table width="100%" border="0" cellpadding="0" cellspacing="0" id="search01" class="bg_search">
            <tr>
              <td ><table border="0" cellpadding="0" cellspacing="1">
                <tr>
                  <td class="td_search">${key.house_number }：</td>
                  <td class="td_search"><input name="houseNumber" id="outHouseName" type="text" class="inputtext" size="16" onchange="this.value=stringfilter(this.value)" onkeydown="submitResearch();" /></td>
                  <td class="td_search">${key.owner_name }：</td>
                  <td class="td_search"><input name="ownerName" type="text" class="inputtext" size="16"  onchange="this.value=stringfilter(this.value)"   onkeydown="submitResearch();" /></td>
                  <td class="td_search"><table border="0" cellpadding="0" cellspacing="0" >
                      <tr>
                        <td class="buttonOffLeft" id="btn1_111"></td>
                        <td class="buttonOffMiddle" id="btn1_112" onblur="btn_change(11)" onClick="search(0);" onMouseOver="btn_change_over(11)" onMouseOut="btn_change_out(11)"><img src="${ctx }/images/ico_searchico.gif" alt="" border="0" align="absmiddle" /> ${key.query }</td>
                        <td class="buttonOffRight" id="btn1_113"></td>
                      </tr>
                  </table></td>
                  <td><table border="0" cellpadding="0" cellspacing="0">
                  </table></td>
                </tr>
              </table></td>
            </tr>
          </table>
          </form>
</div>

<div id="proRightModificationSearch" style="display:none">
<form name="searchModForm" id="searchModForm" target="proRightModIfm" method="post" action="${ctx}/house_proRightModificationAction.do?method=proRightModificationList">
  <table width="100%" border="0" cellpadding="0" cellspacing="0"   id="search02"  class="bg_search"  style="display:block">
            <tr>
              <td><table border="0" cellpadding="0" cellspacing="1">
                <tr>
				   <td class="grid align_left">${key.building }：</td>
                   <td class="td_search align_left">
                      <pms:unitedSelect id="buildingId"
                                            selectText="${key.select }"
											name="buildingId"
											dataList="${buildings}"
											optionLabel="name"
											optionValue="keyword">
										</pms:unitedSelect>
                  </td>
				   <td class="grid align_left">${key.house_number }：</td>
                  <td class="td_search align_left">
                    <input name="houseNumber" id="proRightHouseNumber" type="text" class="inputtext" size="16"  onchange="this.value=stringfilter(this.value)" />
                  </td>
                  <td class="td_search"><table border="0" cellpadding="0" cellspacing="0" >
                      <tr>
                        <td class="buttonOffLeft" id="btn1_11"></td>
                        <td class="buttonOffMiddle" id="btn1_12" onblur="btn_change(1)" onClick="search(1);" onMouseOver="btn_change_over(1)" onMouseOut="btn_change_out(1)"><img src="${ctx }/images/ico_searchico.gif" alt="" border="0" align="absmiddle" /> ${key.query }</td>
                        <td class="buttonOffRight" id="btn1_13"></td>
                      </tr>
                  </table></td>
                  <td><table border="0" cellpadding="0" cellspacing="0">
                  </table></td>
                </tr>
              </table></td>
            </tr>
          </table>
</form>
</div>

<div id="goOutFunction" style="display:none">

  <table border="0" cellpadding="0" cellspacing="0" id="ico1">
		<tr>
		<pms:AuthTag authName="house_proRightModificationAction.do?method=initGoOutAdd">
		<td class="toolbarico" ><a href="#"  onClick="openWithdrawAdd();"onFocus="this.blur()"><img src="${ctx }/images/ico_newfile.gif" border="0" align="absbottom" alt="${key.go_out_add }"/></a></td>
		</pms:AuthTag>
		<pms:AuthTag authName="house_proRightModificationAction.do?method=initGoOutEdit">
		<td class="toolbarico"><a href="#"  onClick="openWithdrawEdit();"onFocus="this.blur()"><img src="${ctx }/images/ico_amend.gif" border="0" align="absbottom" alt="${key.go_out_edit }"/></a></td>
		</pms:AuthTag>
		<td class="toolbar_line">|</td>
        <td class="toolbarico"   onclick="goOutPrint();"><a href="#" onFocus="this.blur()"><img src="${ctx }/images/ico_printer.gif" border="0" align="absbottom" alt="${key.go_out_print }"/></a></td>
		</tr>
   </table>

</div>

<pms:tabPanel  panelId="proRightModificationMain" iframeId="proRightModIfm" defaultHeight="450px">
 <pms:AuthTag authName="house_proRightModificationAction.do?isFirst=true&method=goOutList">
	 <pms:tab caption="${key.go_out }"
	    baseUrl="${ctx }/house_proRightModificationAction.do?method=goOutList&isFirst=true"
	    tabId="goOutList"
	    topDiv="goOutSearch"
		rightDiv="goOutFunction"
	    defaultTab="true"
	    beforeFunction="setListType('goOutOne');"
	    />
</pms:AuthTag>

<pms:AuthTag authName="house_proRightModificationAction.do?isFirst=true&method=goOutListTwo">
	 <pms:tab caption="${key.go_out }"
	    baseUrl="${ctx }/house_proRightModificationAction.do?method=goOutListTwo&isFirst=true"
	    tabId="goOutList2"
	    topDiv="goOutSearch"
		beforeFunction="setListType('goOutTwo');"
	   />
</pms:AuthTag>
<pms:AuthTag authName="house_proRightModificationAction.do?isFirst=true&method=proRightModificationList">
 <pms:tab caption="${key.pro_right_change_history }"
    baseUrl="${ctx}/house_proRightModificationAction.do?method=proRightModificationList&isFirst=true"
    topDiv="proRightModificationSearch"
    tabId="proRightModificationList"
    beforeFunction="setListType('proRight');"
   />
</pms:AuthTag>

</pms:tabPanel>

</body>
</html>

